<template>
  <div>
    <h2>{{ contract.name }}</h2>
    <p>状态：{{ contract.status }}</p>
    <!-- 其他详细信息 -->
  </div>
</template>

<script>
import contractApi from '@/services/contractApi';

export default {
  data() {
    return {
      contract: {}
    };
  },
  created() {
    this.fetchContract();
  },
  methods: {
    async fetchContract() {
      const id = this.$route.params.id;
      try {
        const response = await contractApi.getContractById(id);
        this.contract = response.data;
      } catch (error) {
        console.error(error);
      }
    }
  }
};
</script>